#include "ICPNode.h"

#include "BasAirport.h"
#include "SchDuty.h"

int ICPNode::_countId = 0;

ICPNode::ICPNode(time_t date, BasAirport* airport) : _date(date), _airport(airport) { _id = _countId++; }

ICPNode::~ICPNode() {}

bool ICPNode::cmpByDate(ICPNode* a, ICPNode* b) {
    if (a->getDate() < b->getDate()) {
        return true;
    }
    return false;
}

void ICPNode::print() {
    cout << "* Node-> id-" << _id;
    cout << " airport-" << _airport->getCode3();
    cout << " date-" << getTimeStr(_date) << endl;

    // cout << endl;

    // for (int i = 0; i < _outDutyList.size(); i++)
    //{
    //	_outDutyList[i]->print();
    // }
    // if (_prevduty != null)
    //{
    //	cout << "prevduty: ";
    //	_prevduty->print();
    // }
}
